#!/usr/bin/env node
import { Command } from "commander";
import VMI from ".";
import { pkg } from "./uitls";
import type { CONFIG, SERVER_CONFIG } from "../types/config";


const vmi = new VMI();

const program = new Command();

program.name(pkg.name).usage("[commands]");

program
  .command("start")
  .description("start site of components server")
  .option("-p, --port <value>", "a port of server", parseInt)
  .action((options: SERVER_CONFIG) => {
    vmi.start(options);
  });

program
  .command("test")
  .description("test")
  .action((options: CONFIG) => {
    console.log(options);
  });

program.version(pkg.version).parse(process.argv);
